#ifndef _IRTC_
#define _IRTC_

#include "config.h"



#define IRTC_CSEN IRTCON|=BIT(0)
#define IRTC_CSDIS IRTCON&=~BIT(0)
u8 read_rtc_reg(void);
void write_rtc_reg(u8 cmd);
void write_rtc_ram(u8 addr,u8 dat);
u8 read_rtc_ram(u8 addr);
u8 irtc_sr_byte(u8 x);





#define WRITE_RTC_SEC 			0x50
#define READ_RTC_SEC  			0x40
#define WRITE_RTC_ALM 			0x38
#define READ_RTC_ALM  			0x39
#define WRITE_RTC_REG  			0x3a
#define READ_RTC_REG  			0x3b
#define WRITE_RTC_RAM  			0x3c
#define READ_RTC_RAM 		 	0x3d



#endif